#pragma once

#include <functional>

class CodecWrapper;
class RTPDecoderHandle;
class StreamSummary {
public:	
	bool firstPacket{true};
	uint16_t currentSeq{0};	
	uint64_t statTimeoutSeqCount{0};
	uint64_t statCurrentFrameTime{0};
	uint64_t statBadFrameCount{0};
	uint64_t statDecodeFailCount{0};
	uint64_t statTotalSeqCount{0};
	uint64_t lastProcessTime{0};
	uint64_t statDecodeWithLostCount{0};
	uint64_t statTotalDecodeFrameCount{0};
	uint64_t statKeyFrameCount{0};
	uint64_t frameTime{0};
	bool newFrame{true};
private:
	constexpr static uint64_t WAIT_SEQ_TIME_MS{500};
public:
	void CheckFirstFrame(uint16_t seq);	
	bool IsLastProcessMoreThan500ms();
	bool IsLowerThanCurrentSeq(uint16_t seq);
	bool IsHigherThanCurrentSeq(uint16_t seq);
	bool IsWantSeq(uint16_t seq);
	uint16_t GetLostSeqSize(uint16_t seq);
	void SetNextCurrentSeq(uint16_t seq);
	
	bool IsHigherThanPreviousFrameTime(uint32_t frameTime);
};